home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
038a
/
bas_int1.zip
/
SCROLBOX.BAS
< prev
next >
Wrap
BASIC Source File
|
1991-03-02
|
4KB
|
61 lines
'============================================================================
' Date : 25-Feb-91
' From : Larry Stone
'Subject : Scrolling
'Below is code that will let you scroll ANY window area; you simply tell
'the routines top, bottom, left, and right sides of the window and how
'many lines to scroll and, what color attributes to set in the scrolled
'area. Note that BASIC will not be informed of this color and,
'consequently, when you print to the scrolled area, BASIC will print with
'the last BASIC color values established. Also note that unlike BASIC's
'VIEW PRINT command, you could draw a box and call the ScrollWindowUp or
'ScrollWindowDown routines to scroll within the box - leaving the box
'undisturbed. Final note: The below routines will not help you once you
'have shelled to DOS or another program.
'===========================================================================
DECLARE FUNCTION ColorAttr% (Fg%, Bg%)
DECLARE SUB ScrollWindowDown (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)
DECLARE SUB ScrollWindowUp (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)
' $INCLUDE: 'qb.bi'
DEFINT A-Z
FUNCTION ColorAttr% (Fg%, Bg%) STATIC
'**** Convert Foreground & Background colors to a screen attribute.
BColr% = Bg% * 16 'Put Back color into range
FColr% = Fg% 'Set forground color
IF FColr% > 15 THEN BColr% = BColr% + 128 'If blink attr, put into Back
FColr% = FColr% AND 15 'Remove blink from Fore
ColorAttr% = FColr% + BColr% 'Create attribute integer
END FUNCTION
SUB ScrollWindowDown (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)
DIM reg AS RegType 'Setup the registers
reg.ax = &H700 + HowMany% 'Scroll down HowMany% lines
reg.bx = ColorAttr%(Fg%, Bg%) * 256 'Color attribute of new line
reg.cx = (Trow% - 1) * 256 + Lcol% - 1 'Upper left corner
reg.dx = (Brow% - 1) * 256 + Rcol% - 1 'Lower right corner
intNo% = &H10 'DOS Video BIOS service
CALL Interrupt(intNo%, reg, reg)
END SUB
SUB ScrollWindowUp (Trow%, Lcol%, Brow%, Rcol%, HowMany%, Fg%, Bg%)
DIM reg AS RegType 'Setup the registers
reg.ax = &H600 + HowMany% 'Scroll up HowMany% lines
reg.bx = ColorAttr%(Fg%, Bg%) * 256 'Color attribute of new line
reg.cx = (Trow% - 1) * 256 + Lcol% - 1 'Upper left corner
reg.dx = (Brow% - 1) * 256 + Rcol% - 1 'Lower right corner
intNo% = &H10 'DOS Video BIOS service
CALL Interrupt(intNo%, reg, reg)
END SUB